/* GUI CONVERTED from remaxfer.p (converter v1.76) Thu Apr 25 19:00:58 2002 */
/* remaxfer.p - REPETITIVE (Check transferred out value)                      */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.3.1.2 $                                                       */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 7.3          LAST MODIFIED: 09/13/95   BY: WUG *G0Y1*            */
/* REVISION: 8.6          LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan     */
/* REVISION: 9.1          LAST MODIFIED: 08/12/00   BY: *N0KP* Mark Brown     */
/* $Revision: 1.3.1.2 $   BY: Jean Miller        DATE: 04/16/02  ECO: *P05H*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/*! SUBPROGRAM   TO   ENSURE   NEW    TRANSFERRED-OUT    VALUE
    (TRANSFERRED_OUT  +  TRANSFERRED_CHANGE)  IS  BETWEEN  0  AND THE
    TRANSFERRED-IN VALUE.  ALSO  FIXES  TRANSFERRED-OUT  VALUES  THAT
    EXCEEDED TRANSFERRED-IN VALUES (PER ECO G0WB).  */

define input parameter transferred_in as decimal.
define input parameter transferred_out as decimal.
define input-output parameter transferred_chg as decimal.

if transferred_in >= 0 then do:

   if transferred_out + transferred_chg > transferred_in then do:
      transferred_chg = transferred_in - transferred_out.
   end.

   else
   if transferred_out + transferred_chg < 0 then do:
      transferred_chg = - transferred_out.
   end.

end.

else do:

   if transferred_out + transferred_chg < transferred_in then do:
      transferred_chg = transferred_in - transferred_out.
   end.

   else
   if transferred_out + transferred_chg > 0 then do:
      transferred_chg = - transferred_out.
   end.

end.
